package logic

import (
	"context"
	"onerk4/zg5yk/ordering/common/proto/order"
	"onerk4/zg5yk/ordering/service/server"
)

type OrderServer struct {
	order.UnimplementedOrderServer
}

func (o OrderServer) CreateOrder(ctx context.Context, req *order.CreateOrderRequest) (*order.CreateOrderResponse, error) {
	createOrder, err := server.CreateOrder(req)
	if err != nil {
		return nil, err
	}
	return createOrder, nil
}

func (o OrderServer) Callback(ctx context.Context, req *order.CallbackRequest) (*order.CallbackResponse, error) {
	createOrder, err := server.Callback(req)
	if err != nil {
		return nil, err
	}
	return createOrder, nil
}

func (o OrderServer) ShowOrderList(ctx context.Context, req *order.ShowOrderListRequest) (*order.ShowOrderListResponse, error) {
	createOrder, err := server.ShowOrderList(req)
	if err != nil {
		return nil, err
	}
	return createOrder, nil
}
